/*
MIT License

Copyright(c) 2019 megai2

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files(the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions :

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

*/
#include "stdafx.h"

#ifdef ENABLE_METRICS

#define D912PXY_ROUTE_IMPL_START d912pxy_metrics_api_overhead_timer timer(__LINE__, __FUNCTION__);
#define D912PXY_ROUTE_IMPL_END
#define D912PXY_ROUTE_IMPL_STUB(ret) obj->com.ImplStubCall(__FUNCTION__, __LINE__); return ret
#define D912PXY_ROUTE_IMPL_STUB_(ret) obj->com.ImplStubCall(__FUNCTION__, __LINE__); 

#ifndef ROUTE_COM_IUNK_DEFAULT
#define ROUTE_COM_IUNK_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_comhandler

#define D912PXY_ROUTE_IMPL_PREFIX return obj->com.

D912PXY_METHOD_IMPL(QueryInterface)(PXY_THIS_ REFIID riid, void** ppvObj)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX QueryInterface(riid, ppvObj);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(ULONG, AddRef)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX AddRef();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(ULONG, Release)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Release();
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN 
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

//device
#ifndef ROUTE_DEVICE_DEFAULT
#define ROUTE_DEVICE_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_device

#define D912PXY_ROUTE_IMPL_PREFIX return obj->device.

D912PXY_METHOD_IMPL_(ULONG, ReleaseDevice)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX ReleaseDevice();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(TestCooperativeLevel)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX TestCooperativeLevel();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(UINT, GetAvailableTextureMem)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetAvailableTextureMem();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(EvictManagedResources)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX EvictManagedResources();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDirect3D)(PXY_THIS_ IDirect3D9** ppD3D9)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDirect3D(ppD3D9);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDeviceCaps)(PXY_THIS_ D3DCAPS9* pCaps)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDeviceCaps(pCaps);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDisplayMode)(PXY_THIS_ UINT iSwapChain, D3DDISPLAYMODE* pMode)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDisplayMode(iSwapChain, pMode);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetCreationParameters)(PXY_THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetCreationParameters(pParameters);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetCursorProperties)(PXY_THIS_ UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(void, SetCursorPosition)(PXY_THIS_ int X, int Y, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetCursorPosition(X, Y, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(BOOL, ShowCursor)(PXY_THIS_ BOOL bShow)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX ShowCursor(bShow);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateAdditionalSwapChain)(PXY_THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateAdditionalSwapChain(pPresentationParameters, pSwapChain);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetSwapChain)(PXY_THIS_ UINT iSwapChain, IDirect3DSwapChain9** pSwapChain)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetSwapChain(iSwapChain, pSwapChain);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(UINT, GetNumberOfSwapChains)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetNumberOfSwapChains();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Reset)(PXY_THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Reset(pPresentationParameters);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Present)(PXY_THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetBackBuffer)(PXY_THIS_ UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetRasterStatus)(PXY_THIS_ UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetRasterStatus(iSwapChain, pRasterStatus);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetDialogBoxMode)(PXY_THIS_ BOOL bEnableDialogs)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetDialogBoxMode(bEnableDialogs);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(void, SetGammaRamp)(PXY_THIS_ UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetGammaRamp(iSwapChain, Flags, pRamp);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(void, GetGammaRamp)(PXY_THIS_ UINT iSwapChain, D3DGAMMARAMP* pRamp)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetGammaRamp(iSwapChain, pRamp);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateTexture)(PXY_THIS_ UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateVolumeTexture)(PXY_THIS_ UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateCubeTexture)(PXY_THIS_ UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateVertexBuffer)(PXY_THIS_ UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateVertexBuffer(Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateIndexBuffer)(PXY_THIS_ UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateRenderTarget)(PXY_THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateDepthStencilSurface)(PXY_THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UpdateSurface)(PXY_THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX UpdateSurface(pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UpdateTexture)(PXY_THIS_ IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX UpdateTexture(pSourceTexture, pDestinationTexture);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetRenderTargetData)(PXY_THIS_ IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetRenderTargetData(pRenderTarget, pDestSurface);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetFrontBufferData)(PXY_THIS_ UINT iSwapChain, IDirect3DSurface9* pDestSurface)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetFrontBufferData(iSwapChain, pDestSurface);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(StretchRect)(PXY_THIS_ IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX StretchRect(pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(ColorFill)(PXY_THIS_ IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX ColorFill(pSurface, pRect, color);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateOffscreenPlainSurface)(PXY_THIS_ UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetRenderTarget)(PXY_THIS_ DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetRenderTarget(RenderTargetIndex, pRenderTarget);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetRenderTarget)(PXY_THIS_ DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetRenderTarget(RenderTargetIndex, ppRenderTarget);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetDepthStencilSurface)(PXY_THIS_ IDirect3DSurface9* pNewZStencil)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetDepthStencilSurface(pNewZStencil);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDepthStencilSurface)(PXY_THIS_ IDirect3DSurface9** ppZStencilSurface)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDepthStencilSurface(ppZStencilSurface);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(BeginScene)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX BeginScene();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(EndScene)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX EndScene();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Clear)(PXY_THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Clear(Count, pRects, Flags, Color, Z, Stencil);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetTransform)(PXY_THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetTransform(State, pMatrix);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetTransform)(PXY_THIS_ D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetTransform(State, pMatrix);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(MultiplyTransform)(PXY_THIS_ D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX MultiplyTransform(State, pMatrix);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetViewport)(PXY_THIS_ CONST D3DVIEWPORT9* pViewport)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetViewport(pViewport);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetViewport)(PXY_THIS_ D3DVIEWPORT9* pViewport)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetViewport(pViewport);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetMaterial)(PXY_THIS_ CONST D3DMATERIAL9* pMaterial)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetMaterial(pMaterial);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetMaterial)(PXY_THIS_ D3DMATERIAL9* pMaterial)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetMaterial(pMaterial);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetLight)(PXY_THIS_ DWORD Index, CONST D3DLIGHT9* Light)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetLight(Index, Light);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetLight)(PXY_THIS_ DWORD Index, D3DLIGHT9* Light)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetLight(Index, Light);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(LightEnable)(PXY_THIS_ DWORD Index, BOOL Enable)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX LightEnable(Index, Enable);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetLightEnable)(PXY_THIS_ DWORD Index, BOOL* pEnable)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetLightEnable(Index, pEnable);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetClipPlane)(PXY_THIS_ DWORD Index, CONST float* pPlane)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetClipPlane(Index, pPlane);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetClipPlane)(PXY_THIS_ DWORD Index, float* pPlane)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetClipPlane(Index, pPlane);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetRenderState)(PXY_THIS_ D3DRENDERSTATETYPE State, DWORD Value)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetRenderState(State, Value);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetRenderState_Tracked)(PXY_THIS_ D3DRENDERSTATETYPE State, DWORD Value)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetRenderState_Tracked(State, Value);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetRenderState)(PXY_THIS_ D3DRENDERSTATETYPE State, DWORD* pValue)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetRenderState(State, pValue);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateStateBlock)(PXY_THIS_ D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateStateBlock(Type, ppSB);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(BeginStateBlock)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX BeginStateBlock();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(EndStateBlock)(PXY_THIS_ IDirect3DStateBlock9** ppSB)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX EndStateBlock(ppSB);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetClipStatus)(PXY_THIS_ CONST D3DCLIPSTATUS9* pClipStatus)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetClipStatus(pClipStatus);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetClipStatus)(PXY_THIS_ D3DCLIPSTATUS9* pClipStatus)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetClipStatus(pClipStatus);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetTexture)(PXY_THIS_ DWORD Stage, IDirect3DBaseTexture9** ppTexture)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetTexture(Stage, ppTexture);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetTexture)(PXY_THIS_ DWORD Stage, IDirect3DBaseTexture9* pTexture)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetTexture(Stage, pTexture);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetTextureStageState)(PXY_THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetTextureStageState(Stage, Type, pValue);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetTextureStageState)(PXY_THIS_ DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetTextureStageState(Stage, Type, Value);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetSamplerState)(PXY_THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetSamplerState(Sampler, Type, pValue);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetSamplerState)(PXY_THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetSamplerState(Sampler, Type, Value);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetSamplerState_Tracked)(PXY_THIS_ DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetSamplerState_Tracked(Sampler, Type, Value);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(ValidateDevice)(PXY_THIS_ DWORD* pNumPasses)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX ValidateDevice(pNumPasses);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetPaletteEntries)(PXY_THIS_ UINT PaletteNumber, CONST PALETTEENTRY* pEntries)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetPaletteEntries(PaletteNumber, pEntries);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPaletteEntries)(PXY_THIS_ UINT PaletteNumber, PALETTEENTRY* pEntries)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPaletteEntries(PaletteNumber, pEntries);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetCurrentTexturePalette)(PXY_THIS_ UINT PaletteNumber)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetCurrentTexturePalette(PaletteNumber);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetCurrentTexturePalette)(PXY_THIS_ UINT *PaletteNumber)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetCurrentTexturePalette(PaletteNumber);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetScissorRect)(PXY_THIS_ CONST RECT* pRect)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetScissorRect(pRect);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetScissorRect)(PXY_THIS_ RECT* pRect)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetScissorRect(pRect);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetSoftwareVertexProcessing)(PXY_THIS_ BOOL bSoftware)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetSoftwareVertexProcessing(bSoftware);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(BOOL, GetSoftwareVertexProcessing)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetSoftwareVertexProcessing();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetNPatchMode)(PXY_THIS_ float nSegments)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetNPatchMode(nSegments);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(float, GetNPatchMode)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetNPatchMode();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawPrimitive)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawPrimitive_Compat)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawPrimitive_Compat(PrimitiveType, StartVertex, PrimitiveCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawIndexedPrimitive)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawPrimitiveUP)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawPrimitiveUP(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawPrimitiveUP_StateUnsafe)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawPrimitiveUP_StateUnsafe(PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawIndexedPrimitiveUP)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawIndexedPrimitiveUP_StateUnsafe)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawIndexedPrimitiveUP_StateUnsafe(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(ProcessVertices)(PXY_THIS_ UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateVertexDeclaration)(PXY_THIS_ CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateVertexDeclaration(pVertexElements, ppDecl);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetVertexDeclaration)(PXY_THIS_ IDirect3DVertexDeclaration9* pDecl)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetVertexDeclaration(pDecl);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetVertexDeclaration)(PXY_THIS_ IDirect3DVertexDeclaration9** ppDecl)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetVertexDeclaration(ppDecl);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetFVF)(PXY_THIS_ DWORD FVF)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetFVF(FVF);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetFVF)(PXY_THIS_ DWORD* pFVF)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetFVF(pFVF);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateVertexShader)(PXY_THIS_ CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateVertexShader(pFunction, ppShader);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetVertexShader)(PXY_THIS_ IDirect3DVertexShader9* pShader)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetVertexShader(pShader);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetVertexShader)(PXY_THIS_ IDirect3DVertexShader9** ppShader)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetVertexShader(ppShader);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetVertexShaderConstantF)(PXY_THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetVertexShaderConstantF)(PXY_THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetVertexShaderConstantI)(PXY_THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetVertexShaderConstantI)(PXY_THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetVertexShaderConstantB)(PXY_THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetVertexShaderConstantB)(PXY_THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetStreamSource)(PXY_THIS_ UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetStreamSource)(PXY_THIS_ UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetStreamSource(StreamNumber, ppStreamData, pOffsetInBytes, pStride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetStreamSourceFreq)(PXY_THIS_ UINT StreamNumber, UINT Setting)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetStreamSourceFreq(StreamNumber, Setting);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetStreamSourceFreq)(PXY_THIS_ UINT StreamNumber, UINT* pSetting)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetStreamSourceFreq(StreamNumber, pSetting);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetIndices)(PXY_THIS_ IDirect3DIndexBuffer9* pIndexData)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetIndices(pIndexData);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetIndices)(PXY_THIS_ IDirect3DIndexBuffer9** ppIndexData)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetIndices(ppIndexData);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreatePixelShader)(PXY_THIS_ CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreatePixelShader(pFunction, ppShader);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetPixelShader)(PXY_THIS_ IDirect3DPixelShader9* pShader)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetPixelShader(pShader);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPixelShader)(PXY_THIS_ IDirect3DPixelShader9** ppShader)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPixelShader(ppShader);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetPixelShaderConstantF)(PXY_THIS_ UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPixelShaderConstantF)(PXY_THIS_ UINT StartRegister, float* pConstantData, UINT Vector4fCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetPixelShaderConstantI)(PXY_THIS_ UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPixelShaderConstantI)(PXY_THIS_ UINT StartRegister, int* pConstantData, UINT Vector4iCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetPixelShaderConstantB)(PXY_THIS_ UINT StartRegister, CONST BOOL* pConstantData, UINT  BoolCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPixelShaderConstantB)(PXY_THIS_ UINT StartRegister, BOOL* pConstantData, UINT BoolCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawRectPatch)(PXY_THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawTriPatch)(PXY_THIS_ UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DeletePatch)(PXY_THIS_ UINT Handle)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DeletePatch(Handle);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateQuery)(PXY_THIS_ D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateQuery(Type, ppQuery);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(CreateQuery_Optimized)(PXY_THIS_ D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX CreateQuery_Optimized(Type, ppQuery);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(DrawIndexedPrimitive_Compat)(PXY_THIS_ D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX DrawIndexedPrimitive_Compat(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Present_PG)(PXY_THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Present_PG(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Present_Extra)(PXY_THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Present_Extra(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Clear_Emulated)(PXY_THIS_ DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Clear_Emulated(Count, pRects, Flags, Color, Z, Stencil);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetStreamSource_CAR)(PXY_THIS_ UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetStreamSource_CAR(StreamNumber, pStreamData, OffsetInBytes, Stride);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetIndices_CAR)(PXY_THIS_ IDirect3DIndexBuffer9* pIndexData)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetIndices_CAR(pIndexData);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetViewport_CAR)(PXY_THIS_ CONST D3DVIEWPORT9* pViewport)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetViewport_CAR(pViewport);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetScissorRect_CAR)(PXY_THIS_ CONST RECT* pRect)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetScissorRect_CAR(pRect);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetRenderTarget_Compat)(PXY_THIS_ DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX SetRenderTarget_Compat(RenderTargetIndex, pRenderTarget);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_RESOURCE_DEFAULT
#define ROUTE_RESOURCE_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_resource

#define D912PXY_ROUTE_IMPL_PREFIX return obj->res.

D912PXY_METHOD_IMPL(SetPrivateData)(PXY_THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPrivateData)(PXY_THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(FreePrivateData)(PXY_THIS_ REFGUID refguid)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, SetPriority)(PXY_THIS_ DWORD PriorityNew)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, GetPriority)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(void, PreLoad)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(D3DRESOURCETYPE, GetType)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetType();
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_VSTREAM_DEFAULT
#define ROUTE_VSTREAM_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_vstream

#define D912PXY_ROUTE_IMPL_PREFIX return obj->vstream.

D912PXY_METHOD_IMPL(Lock)(PXY_THIS_ UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Lock(OffsetToLock, SizeToLock, ppbData, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Unlock)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Unlock();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDesc)(PXY_THIS_ D3DVERTEXBUFFER_DESC *pDesc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_SURFACE_DEFAULT
#define ROUTE_SURFACE_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_surface

#define D912PXY_ROUTE_IMPL_PREFIX return obj->surface.

D912PXY_METHOD_IMPL(GetContainer)(PXY_THIS_ REFIID riid, void** ppContainer)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDesc)(PXY_THIS_ D3DSURFACE_DESC *pDesc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDesc(pDesc);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(LockRect)(PXY_THIS_ D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX LockRect(pLockedRect, pRect, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UnlockRect)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX UnlockRect();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDC)(PXY_THIS_ HDC *phdc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(ReleaseDC)(PXY_THIS_ HDC hdc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_QUERY_DEFAULT
#define ROUTE_QUERY_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_query

#define D912PXY_ROUTE_IMPL_PREFIX return obj->query.

D912PXY_METHOD_IMPL_(D3DQUERYTYPE, GetType)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetType();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, GetDataSize)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDataSize();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Issue)(PXY_THIS_ DWORD dwIssueFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Issue(dwIssueFlags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetData)(PXY_THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetData(pData, dwSize, dwGetDataFlags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDataZeroOverride)(PXY_THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDataZeroOverride(pData, dwSize, dwGetDataFlags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDataOneOverride)(PXY_THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDataOneOverride(pData, dwSize, dwGetDataFlags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(IssueNOP)(PXY_THIS_ DWORD dwIssueFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX IssueNOP(dwIssueFlags);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_QUERY_OCC_DEFAULT
#define ROUTE_QUERY_OCC_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_query_occlusion

#define D912PXY_ROUTE_IMPL_PREFIX return obj->query_occ.

D912PXY_METHOD_IMPL(occ_Issue)(PXY_THIS_ DWORD dwIssueFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX occ_Issue(dwIssueFlags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(occ_GetData)(PXY_THIS_ void* pData, DWORD dwSize, DWORD dwGetDataFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX occ_GetData(pData, dwSize, dwGetDataFlags);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_BASE_TEX_DEFAULT
#define ROUTE_BASE_TEX_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_basetexture

#define D912PXY_ROUTE_IMPL_PREFIX return obj->basetex.

D912PXY_METHOD_IMPL_(DWORD, SetLOD)(PXY_THIS_ DWORD LODNew)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, GetLOD)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, GetLevelCount)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetAutoGenFilterType)(PXY_THIS_ D3DTEXTUREFILTERTYPE FilterType)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(D3DTEXTUREFILTERTYPE, GetAutoGenFilterType)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3DTEXF_NONE);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(void, GenerateMipSubLevels)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, GetPriority_SRVhack)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPriority_SRVhack();
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_TEX_2D_DEFAULT
#define ROUTE_TEX_2D_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_texture

#define D912PXY_ROUTE_IMPL_PREFIX return obj->tex_2d.

D912PXY_METHOD_IMPL(GetLevelDesc)(PXY_THIS_ UINT Level, D3DSURFACE_DESC *pDesc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetLevelDesc(Level, pDesc);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetSurfaceLevel)(PXY_THIS_ UINT Level, IDirect3DSurface9** ppSurfaceLevel)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetSurfaceLevel(Level, ppSurfaceLevel);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(LockRect)(PXY_THIS_ UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX LockRect(Level, pLockedRect, pRect, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UnlockRect)(PXY_THIS_ UINT Level)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX UnlockRect(Level);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(AddDirtyRect)(PXY_THIS_ CONST RECT* pDirtyRect)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX AddDirtyRect(pDirtyRect);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_TEX_3D_DEFAULT
#define ROUTE_TEX_3D_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_vtexture

#define D912PXY_ROUTE_IMPL_PREFIX return obj->tex_3d.

D912PXY_METHOD_IMPL(GetLevelDesc)(PXY_THIS_ UINT Level, D3DVOLUME_DESC *pDesc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetVolumeLevel)(PXY_THIS_ UINT Level, IDirect3DVolume9** ppVolumeLevel)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(LockBox)(PXY_THIS_ UINT Level, D3DLOCKED_BOX* pLockedVolume, CONST D3DBOX* pBox, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UnlockBox)(PXY_THIS_ UINT Level)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(AddDirtyBox)(PXY_THIS_ CONST D3DBOX* pDirtyBox)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_TEX_CUBE_DEFAULT
#define ROUTE_TEX_CUBE_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_ctexture

#define D912PXY_ROUTE_IMPL_PREFIX return obj->tex_cube.

D912PXY_METHOD_IMPL(GetLevelDesc)(PXY_THIS_ UINT Level, D3DSURFACE_DESC *pDesc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetLevelDesc(Level, pDesc);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetCubeMapSurface)(PXY_THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, IDirect3DSurface9** ppCubeMapSurface)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetCubeMapSurface(FaceType, Level, ppCubeMapSurface);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(LockRect)(PXY_THIS_ D3DCUBEMAP_FACES FaceType, UINT Level, D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX LockRect(FaceType, Level, pLockedRect, pRect, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UnlockRect)(PXY_THIS_ D3DCUBEMAP_FACES FaceType, UINT Level)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX UnlockRect(FaceType, Level);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(AddDirtyRect)(PXY_THIS_ D3DCUBEMAP_FACES FaceType, CONST RECT* pDirtyRect)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX AddDirtyRect(FaceType, pDirtyRect);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_VDECL_DEFAULT
#define ROUTE_VDECL_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_vdecl

#define D912PXY_ROUTE_IMPL_PREFIX return obj->vdecl.

D912PXY_METHOD_IMPL(GetDeclaration)(PXY_THIS_ D3DVERTEXELEMENT9* pElement, UINT* pNumElements)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDeclaration(pElement, pNumElements);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_SHADER_DEFAULT
#define ROUTE_SHADER_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_shader

#define D912PXY_ROUTE_IMPL_PREFIX return obj->shader.

D912PXY_METHOD_IMPL(GetFunction)(PXY_THIS_ void* arg, UINT* pSizeOfData)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_SWAPCHAIN_DEFAULT
#define ROUTE_SWAPCHAIN_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_swapchain

#define D912PXY_ROUTE_IMPL_PREFIX return obj->swapchain.

D912PXY_METHOD_IMPL(Present)(PXY_THIS_ CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion, DWORD dwFlags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetFrontBufferData)(PXY_THIS_ IDirect3DSurface9* pDestSurface)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetFrontBufferData(pDestSurface);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetBackBuffer)(PXY_THIS_ UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetBackBuffer(iBackBuffer, Type, ppBackBuffer);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetRasterStatus)(PXY_THIS_ D3DRASTER_STATUS* pRasterStatus)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDisplayMode)(PXY_THIS_ D3DDISPLAYMODE* pMode)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPresentParameters)(PXY_THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetPresentParameters(pPresentationParameters);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(ULONG, ReleaseSwapChain)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX ReleaseSwapChain();
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

#ifndef ROUTE_SURFACE_LAYER_DEFAULT
#define ROUTE_SURFACE_LAYER_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_surface_layer
#define D912PXY_ROUTE_IMPL_PREFIX return obj->layer.

#define D912PXY_ROUTE_IMPL_STUB_CUSTOM(ret) obj->layer.GetBaseSurface()->com.ImplStubCall(__FUNCTION__, __LINE__); return ret
#define D912PXY_ROUTE_IMPL_STUB_CUSTOM_(ret) obj->layer.GetBaseSurface()->com.ImplStubCall(__FUNCTION__, __LINE__); 

D912PXY_METHOD_IMPL(QueryInterface)(PXY_THIS_ REFIID riid, void** ppvObj)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX QueryInterface(riid, ppvObj);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(ULONG, AddRef)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX AddRef();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(ULONG, Release)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX Release();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDevice)(PXY_THIS_ IDirect3DDevice9** ppDevice)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(SetPrivateData)(PXY_THIS_ REFGUID refguid, CONST void* pData, DWORD SizeOfData, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetPrivateData)(PXY_THIS_ REFGUID refguid, void* pData, DWORD* pSizeOfData)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(FreePrivateData)(PXY_THIS_ REFGUID refguid)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, SetPriority)(PXY_THIS_ DWORD PriorityNew)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(DWORD, GetPriority)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(void, PreLoad)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM_(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL_(D3DRESOURCETYPE, GetType)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3DRTYPE_SURFACE);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetContainer)(PXY_THIS_ REFIID riid, void** ppContainer)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDesc)(PXY_THIS_ D3DSURFACE_DESC *pDesc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX GetDesc(pDesc);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(LockRect)(PXY_THIS_ D3DLOCKED_RECT* pLockedRect, CONST RECT* pRect, DWORD Flags)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX LockRect(pLockedRect, pRect, Flags);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(UnlockRect)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_PREFIX UnlockRect();
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(GetDC)(PXY_THIS_ HDC *phdc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(ReleaseDC)(PXY_THIS_ HDC hdc)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB_CUSTOM(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX
#undef D912PXY_ROUTE_IMPL_STUB_CUSTOM
#undef D912PXY_ROUTE_IMPL_STUB_CUSTOM_

#endif

#ifndef ROUTE_SBLOCK_DEFAULT
#define ROUTE_SBLOCK_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_sblock
#define D912PXY_ROUTE_IMPL_PREFIX return obj->sblock

D912PXY_METHOD_IMPL(Capture)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

D912PXY_METHOD_IMPL(Apply)(PXY_THIS)
{
	D912PXY_ROUTE_IMPL_START
		D912PXY_ROUTE_IMPL_STUB(D3D_OK);
	D912PXY_ROUTE_IMPL_END
}

#undef D912PXY_ROUTE_IMPL_PREFIX
#undef D912PXY_METHOD_IMPL_CN

#endif

/*

#ifndef ROUTE_*NAME*_DEFAULT
#define ROUTE_*NAME*_DEFAULT

#define D912PXY_METHOD_IMPL_CN d912pxy_

#define D912PXY_ROUTE_IMPL_PREFIX return obj->

#undef D912PXY_METHOD_IMPL_CN
#undef D912PXY_ROUTE_IMPL_PREFIX

#endif

*/

#endif